﻿using System;
using System.Collections;
using System.Collections.Generic;

namespace Fadd
{
    /// <summary>
    /// DI/IoC fascade
    /// </summary>
    /// <remarks>
    /// The purpose of this interface is to be a IoC wrapper to let you
    /// use your favorite container.
    /// </remarks>
    public interface IServiceResolver
    {
        /// <summary>
        /// Resolve a service
        /// </summary>
        /// <typeparam name="T">Type of service</typeparam>
        /// <returns>Service if found; otherwise <c>null</c>.</returns>
        T Resolve<T>();

        /// <summary>
        /// Resolve a service
        /// </summary>
        /// <param name="type">Type of service</param>
        /// <returns>Service if found; otherwise <c>null</c>.</returns>
        object Resolve(Type type);

        /// <summary>
        /// Resolve all services that implements the specified interface.
        /// </summary>
        /// <typeparam name="T">Type of service to find</typeparam>
        /// <returns>A collection of implementations (or an empty list).</returns>
        IEnumerable<T> ResolveAll<T>();

        /// <summary>
        /// Resolve all services that implements the specified interface.
        /// </summary>
        /// <returns>A collection of implementations (or an empty list).</returns>
        IEnumerable ResolveAll(Type type);

    }
}
